﻿using System.Windows;
using System.Windows.Documents;

namespace VocabCards.Controls
{

    public static class BindableRunProperty 
    {
        public static string GetBindableText(DependencyObject obj)
        {
            return (string)obj.GetValue(BindableTextProperty);
        }

        public static void SetBindableText(DependencyObject obj, string value)
        {
            obj.SetValue(BindableTextProperty, value);
        }

        // Using a DependencyProperty as the backing store for BindableText.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty BindableTextProperty =
            DependencyProperty.RegisterAttached("BindableText", typeof(string), typeof(BindableRunProperty), 
            new PropertyMetadata(""));

        private static void PropertyChangedCallback(DependencyObject dependencyObject, 
            DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            //var run = dependencyObject as Run;
            //if (run != null) run.Text = dependencyPropertyChangedEventArgs.NewValue as string;
        }
    }
}